package org.dx.oho.book.two.pojo;

import org.dx.oho.entity.BaseEntity;

import java.util.Objects;

/**
 * create by duanx 2020/11/4
 *@description： AREA实体类
 *@classname: Area
 *@author: duanx
 *@date: 2020/11/4 20:00
 **/
public class Area extends BaseEntity  {
    /**
     * 区域ID
     */
    private Integer areaId;
    /**
     * 父区划
     */
    private Integer parentId;
    /**
     * 区域Name
     */
    private String areaName;
    /**
     * 区域优先级
     */
    private Integer priority;

    public Integer getAreaId() {
        return areaId;
    }

    public void setAreaId(Integer areaId) {
        this.areaId = areaId;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Area area = (Area) o;
        return Objects.equals(areaId, area.areaId) &&
                Objects.equals(parentId, area.parentId) &&
                Objects.equals(areaName, area.areaName) &&
                Objects.equals(priority, area.priority);
    }

    @Override
    public int hashCode() {
        return Objects.hash(areaId, parentId, areaName, priority);
    }

    @Override
    public String toString() {
        return "Area{" +
                "areaId=" + areaId +
                ", parentId=" + parentId +
                ", areaName='" + areaName + '\'' +
                ", priority=" + priority +
                ", createTime=" + getCreateTime() +
                ", lastEditTime=" + getLastEditTime() +
                '}';
    }
}
